Skip to content

Enhance assembly name reference and system type resolution - #929

Open
denis-kudelin wants to merge 1 commit into
jbevain:masterfrom
denis-kudelin:transitive-dependency-fix
Open

Enhance assembly name reference and system type resolution#929
denis-kudelin wants to merge 1 commit into
jbevain:masterfrom
denis-kudelin:transitive-dependency-fix

Conversation

@denis-kudelin

@denis-kudelin denis-kudelin commented Nov 12, 2023

Copy link
Copy Markdown

This commit refines the system type import functionality in Mono.Cecil to ensure that system types are resolved efficiently and do not introduce unnecessary assembly references. By aligning the import logic with the assembly containing the built-in System.Object type, the mechanism now avoids importing types from system assemblies that the running assembly already references.

Key changes you'll find in this commit:

  • The TryGetAssemblyNameReference method has been updated to prevent importing system types from outside the core system assembly (e.g., mscorlib or System.Private.CoreLib) if a type belongs to the same assembly as System.Object.
  • The TryGetAssemblyNameReference method has been improved to handle both direct and forwarded assembly references with greater precision.

These changes contribute to a leaner import process, eliminating redundant assembly references and adhering to the common developer expectations regarding system type resolution in .NET environments.

@denis-kudelin
denis-kudelin force-pushed the transitive-dependency-fix branch from 737f446 to 89cb8cf Compare November 14, 2023 07:36
@denis-kudelin denis-kudelin changed the title Enhance assembly name reference resolution in ModuleDefinition Enhance assembly name reference and system type resolution Nov 14, 2023
@denis-kudelin
denis-kudelin force-pushed the transitive-dependency-fix branch 7 times, most recently from eee01b0 to e7647d2 Compare November 15, 2023 08:08
@denis-kudelin
denis-kudelin force-pushed the transitive-dependency-fix branch from e7647d2 to 6c9718d Compare November 15, 2023 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant